package com.example.mapp;

import com.example.entity.authority.PartyContractFile;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by youkun on 2018/3/21.
 *机构合同文件
 */
@Mapper
public interface PartyContractFileMapp {

    @Insert("insert into party_Contract_File (file_Path) value (#{filePath})")
    @SelectKey(statement="select last_insert_id()",keyProperty = "id",keyColumn = "id",before = false,resultType = Long.class)
    int insert(PartyContractFile partyContractFile) throws Exception;

    @Select(" select a.* from party_Contract_File as a inner join party_by_file as b on a.id = b.file_Id where b.party_id=#{partyId}")
    List<PartyContractFile> queryByPartyId(String partyId)throws Exception;

    @Delete("delete from party_Contract_File where id=#{id}")
    int deleteByContractId(String id)throws Exception;

}
